package cn.edu.wynu;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Dog {
    String name;
    Integer age;
    public String getName() {
        return name;
    }
    public Dog(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public Dog() {
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("cats.xml");
        Dog bean = (Dog)context.getBean("taidi");
        Dog bean2 = (Dog)context.getBean("taidi2");
        System.out.println(bean);
        System.out.println(bean2);
    }
}